<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加论坛版块</title>
<link href="Images/css1/css.css" rel="stylesheet" type="text/css">
<style>
td, th {
	text-align: center
}
</style>
</head>
<?php
include_once 'common/config.inc.php';
include_once 'common/function.inc.php';
?>
<?php
include 'common/mysql.inc.php';
$sql = "select * from bbs_forum ORDER BY id ASC";
$res = mysql_query($sql);
while($rows = mysql_fetch_assoc($res)) {
        $data[]=$rows;
}

$data = getTree($data);



?>
<body>
<form method='post' action='forum_deal.php' enctype='multipart/form-data'>
  <table class="table" cellspacing="1" cellpadding="2" width="99%"
			align="center" border="0">
    <tbody>
      <tr>
        <th style="text-align:left;" colspan="2" class="bg_tr" align="left" height="25">添加版块</th>
      </tr>
      <tr>
        <td style="text-align:right;" class="td_bg" width="17%" height="23" align="center">版块名称：</td>
        <td style="text-align:left;" class="td_bg">
        	<input type='text' name='title' />
        </td>
      </tr>

	  <tr>
        <td style="text-align:right;" class="td_bg" width="17%" height="23" align="center">所属类别：</td>
        <td style="text-align:left;" class="td_bg">
        	<select name='pid'>
            	<option value='0'>主类别</option>
                <?php
                  foreach($data as $v){
                ?>

                  <option value='<?php echo $v['id']?>'><?php echo str_repeat('┗━',$v['level']); ?><?php echo $v['title']; ?></option>

                <?php

                  }

                ?>
           	</select>
        </td>
      </tr>
	  <tr>
        <td style="text-align:right;" class="td_bg" width="17%" height="23" align="center">版块描述：</td>
        <td style="text-align:left;" class="td_bg">
        	<textarea cols='60' rows='8' name='description'></textarea>
        </td>
      </tr>
      <tr>
        <td style="text-align:right;" class="td_bg" width="17%" height="23" align="center">版块排序：</td>
        <td style="text-align:left;" class="td_bg">
          <input type="text" name="sort" value="50" size="30">
        </td>
      </tr>
	  <tr>
        <td style="text-align:right;" class="td_bg" width="17%" height="23" align="center">&nbsp;</td>
        <td style="text-align:left;" class="td_bg">
        	<input type='hidden' name='act' value='add' />
        	<input type='submit' name='submit' value='提交' />
        </td>
      </tr>
    </tbody>
  </table>
</form>
</body>
</html>